<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Session;
class Coupon extends Controller{
    /****
     Class register     优惠券
     *@
    */
    public function index(){
        $user_id = input('user_id');
        $address = Db::name('coupon')->where(['user_id'=>$user_id])->select();
        if($address){
           $arr = [
               'state'     => 1,
               'address'   =>$address,
               'message'   => "请求成功"
            ]; 
            
        }else{
            $arr = [
               'state'     => 0,
               'message'   => "请求失败"
            ]; 
        }
        return json($arr);
    }




}